Skip to content

Multi-repo runs wait on each PR's CI; the CI wait loop is capped - #214

Merged
nambok merged 1 commit into
mainfrom
fix/multi-repo-ci-wait
Oct 21, 2026
Merged

nambok merged 1 commit into
mainfrom
fix/multi-repo-ci-wait

Conversation

@nambok

@nambok nambok commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A run that opened pull requests in two repositories sat in awaiting_ci for hours, re-checking every two minutes: "Could not read branch head" then "A workflow passed but others are still running". Resume had no multi-repo handling: the run record holds one repo and one branch, and here they belonged to different repositories, so the head couldn't be read and CI never looked complete. The 24-hour backstop never fired because it measured time since the record's last write, and every check rewrites the record.

Changes

  • resume.rs:
    • resume_multi_repo(): a run with more than one entry in pr_urls checks each pull request's own head. All green: every open pull request is marked ready and the run completes. Any failure: the run is handed to a person with a note naming the failing pull requests (the CI fix loop works within one repository). Otherwise it checks again later. Closed pull requests are skipped.
    • may_poll_again() / MAX_RESUME_POLLS (720, about a day at two minutes): send_delayed_resume() counts each re-arm on the run record (ci_resume_polls); past the cap it hands off instead (hand_off_after_ci_wait(): pull requests marked ready, a note, the run completes). This covers single- and multi-repo waits, and record writes can't reset it.

Verification

  • cargo clippy -p worker --all-targets -D warnings clean; cargo test -p worker: 431 passed, 0 failed.
  • The stuck run in production: repo one repository, branch the other's branch, pr_urls with both pull requests.

… loop stops after about a day of checks instead of looping forever
@nambok
nambok merged commit a5f04c2 into main Oct 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant